<?php

use think\migration\Migrator;
use think\migration\db\Column;

class BasicBoiler extends Migrator
{
    /**
     * 基本信息 - 工艺类型
     */
    public function change()
    {
        $table = $this->table('basic_boiler');
        $table
            //step1：名称
            ->addColumn('boiler_name', 'string', ['limit' => 20, 'comment' => '锅炉名称'])
            //step2：关联ID
            ->addColumn('instrument_id', 'integer', ['limit' => 11, 'comment' => '数采仪ID'])
            ->addColumn('company_id', 'integer', ['limit' => 11, 'comment' => '公司ID'])

            ->setComment('基本数据 - 锅炉')
            //引擎
            ->setEngine('InnoDB')
            ->save();
    }

    public function down()
    {
        $this->table('basic_boiler')->drop();
    }
}
